<?php
/*** Changing footer using Hook */
add_filter('genesis_footer_output', 'footer_output_filter', 10, 3);

function footer_output_filter($output, $backtotop_text, $creds_text) {
 //$backtotop_text = '[footer_backtotop text="Top of Page"]';
 $links_footer	= 	'<a href="htt://www.thompsonburton.com/">Home</a> . '.
 					'<a href="http://www.thompsonburton.com/terms/">Terms of Service</a> . '.
					'<a href="http://www.thompsonburton.com/sitemap/">Sitemap</a> ';
 $creds_text = 'Copyright [footer_copyright] <a href="'. trailingslashit( get_bloginfo('url') ) .'" title="'. esc_attr( get_bloginfo('name') ) .' rel="nofollow">'.get_bloginfo('name').'</a> &middot; <a href="http://affiliate-link-to-genesis.com" target="_blank" rel="nofollow">Genesis Theme Framework</a>';
 //$output = '<div class="links">' . $links_footer . '</div>' . '<div class="creds">' . $creds_text . '</div>';
 $output = '<div class="links">' . $links_footer . '</div>';
 return $output;
}



/** Start the engine */

require_once( TEMPLATEPATH . '/lib/init.php' );



/** Child theme library */

require(CHILD_DIR.'/lib/style.php');



/** Child theme (do not remove) */

define( 'CHILD_THEME_NAME', 'Maximum Theme' );

define( 'CHILD_THEME_URL', 'http://market.studiopress.com/themes/maximum' );



/** Add new image sizes */

add_image_size( 'c-Small', 260, 146, TRUE );

add_image_size( 'c-Medium', 390, 218, TRUE );

add_image_size( 'c-Large', 570, 320, TRUE );

add_image_size( 'c-Sidebar', 230, 128, TRUE );

add_image_size( 'c-Featured', 500, 280, TRUE );



/** Reposition the primary navigation */

remove_action( 'genesis_after_header', 'genesis_do_nav' );

add_action( 'genesis_before_header', 'genesis_do_nav' );



/** Wrap the header */

add_action('genesis_before_header', 'header_div_open');

function header_div_open() {

	echo '<div id="headerwrapper">';

}



add_action('genesis_after_header', 'header_div_close', 1);

function header_div_close() {

	echo '</div>';

}



/** Wrap and reposition the breadcrumbs */

add_action('genesis_after_header', 'breadcrumb_div_open');

function breadcrumb_div_open() {

	echo '<div id="breadcrumbwrapper">';

}



remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );

add_action( 'genesis_after_header', 'genesis_do_breadcrumbs' );





add_action('genesis_after_header', 'breadcrumb_div_close');

function breadcrumb_div_close() {

	echo '</div>';

}



/** Add suport for custom background */

add_custom_background();



/** Add support for custom header */

add_theme_support( 'genesis-custom-header', array( 'width' => 960, 'height' => 120, 'textcolor' => '333', 'admin_header_callback' => 'maximum_admin_style' ) );



/**

 * Register a custom admin callback to display the custom header preview with the

 * same style as is shown on the front end.

 *

 */

function maximum_admin_style() {



	$headimg = sprintf( '.appearance_page_custom-header #headimg { background: url(%s) no-repeat; font-family: Oswald, Helvetica, Arial, serif; min-height: %spx; }', get_header_image(), HEADER_IMAGE_HEIGHT );

	$h1 = sprintf( '#headimg h1, #headimg h1 a { color: #%s; font-size: 48px; font-weight: normal; line-height: 48px; margin: 25px 0 0; text-decoration: none; }', esc_html( get_header_textcolor() ) );

	$desc = sprintf( '#headimg #desc { color: #%s; display: none; }', esc_html( get_header_textcolor() ) );



	printf( '<style type="text/css">%1$s %2$s %3$s</style>', $headimg, $h1, $desc );



}



/** Add support for 3-column footer widgets */

add_theme_support( 'genesis-footer-widgets', 3 );



/** Register widget areas */

genesis_register_sidebar( array(

	'id'			=> 'homefeatured',

	'name'			=> __( 'Home Featured', 'maximum' ),

	'description'	=> __( 'This is the featured section.', 'maximum' ),

) );

genesis_register_sidebar( array(

	'id'			=> 'homemiddle-1',

	'name'			=> __( 'Home Middle #1', 'maximum' ),

	'description'	=> __( 'This is the Home Middle #1 section.', 'maximum' ),

) );

genesis_register_sidebar( array(

	'id'			=> 'homemiddle-2',

	'name'			=> __( 'Home Middle #2', 'maximum' ),

	'description'	=> __( 'This is the Home Middle #2 section.', 'maximum' ),

) );

genesis_register_sidebar( array(

	'id'			=> 'homebottom-1',

	'name'			=> __( 'Home Bottom #1', 'maximum' ),

	'description'	=> __( 'This is the Home Bottom #1 section.', 'maximum' ),

) );

genesis_register_sidebar( array(

	'id'			=> 'homebottom-2',

	'name'			=> __( 'Home Bottom #2', 'maximum' ),

	'description'	=> __( 'This is the Home Bottom #2 section.', 'maximum' ),

) );

genesis_register_sidebar( array(

	'id'			=> 'homebottom-3',

	'name'			=> __( 'Home Bottom #3', 'maximum' ),

	'description'	=> __( 'This is the Home Bottom #3 section.', 'maximum' ),

) );



/* shortcode for custom sidebars */

add_shortcode('my-side-bar', 'renderSideBar');

/* to let the shortcode dance in widget */

add_filter('widget_text', 'do_shortcode');





function renderSideBar($atts, $content=null)

{

	global $post;

	

	extract(shortcode_atts(array(

		  'for' 	=> '',

      		), $atts));

			

			

	if($post -> post_name == "{$for}")

		return $content;

}





add_action('wp_footer', 'add_some');



function add_some()

{

	global $post;

	echo '<script type="text/javascript">';

	echo 'jQuery(document).ready(function($){';

	

	if($post -> post_name != 'kevinthompson' and $post -> post_name != 'walt-burton')

		echo '$("#text-6").hide();';

		



	if($post -> post_name == 'mlm-attorney' or $post -> post_name == 'commercial-real-estate')

		echo '$("#inner").css({\'width\':\'1000px\'});';

	echo '});';

	echo '</script>';

}





/* shortcode for social link Kevin*/

/*add_shortcode('social-profiles', 'socialProfile');



function socialProfile($atts)

{

	extract(shortcode_atts(array(

		  'for' 	=> '',

      		), $atts));

			

			

	global $post;

	

	if($post -> post_name == "{$for}")

	{

		$social = '<ul class="social-profiles">';

		$social .= '<li><a href="http://www.twitter.com/kevin_thompson"><img src="http://thompsonburton.com/wp-content/uploads/2012/04/Twitter_48x48.png" border="0" /></a></li>';

		$social .= '<li><a href="http://www.facebook.com/mlmlegal"><img src="http://thompsonburton.com/wp-content/uploads/2012/04/Facebook_48x48.png" border="0" /></a></li>';

		$social .= '<li><a href="http://www.linkedin.com/in/ktprofile"><img src="http://thompsonburton.com/wp-content/uploads/2012/04/Linkedin_48x48.png" border="0" /></a></li>';

		$social .= '<li><a href="https://plus.google.com/110654235407399286843/posts"><img src="http://thompsonburton.com/wp-content/uploads/2012/04/Google-64.png" border="0" width="48" /></a></li>';

		$social .= '</ul>';

		

		$social .= '<div style="clear:both"></div>';

	}

	

	return $social;

}
*/


/* shortcode for social link Kevin*/
add_shortcode('social-profiles', 'socialProfile');

function socialProfile($atts)
{
	extract(shortcode_atts(array(
		  'for' 	=> '',
      		), $atts));
			
			
	global $post;
	
	if($post -> post_name == "{$for}")
	{
		$social = '<ul class="social-profiles">';
		$social .= '<li><a href="http://www.twitter.com/kevin_thompson"><img src="http://thompsonburton.com/wp-content/uploads/2012/04/Twitter_48x481.png" border="0" /></a></li>';
		$social .= '<li><a href="http://www.facebook.com/mlmlegal"><img src="http://thompsonburton.com/wp-content/uploads/2012/04/Facebook_48x481.png" border="0" /></a></li>';
		$social .= '<li><a href="http://www.linkedin.com/in/ktprofile"><img src="http://thompsonburton.com/wp-content/uploads/2012/04/Linkedin_48x481.png" border="0" /></a></li>';
		$social .= '<li><a href="https://plus.google.com/110654235407399286843/posts"><img src="http://thompsonburton.com/wp-content/uploads/2012/04/GooglePlus-Yellow-48.png" widht="44" border="0" /></a></li>';
		$social .= '</ul>';
		
		$social .= '<div style="clear:both"></div>';
	}
	
	return $social;
}